﻿<phone:PhoneApplicationPage 
    x:Class="Baseball.Views.Main"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    shell:SystemTray.Opacity="0">

    <Grid x:Name="LayoutRoot" Language="ko-kr">
        
        <TextBlock Text="프로야구" FontSize="30" FontWeight="Bold"
                       VerticalAlignment="Top" Margin="20,40,0,0"
                       Foreground="{StaticResource PhoneAccentBrush}"/>
        <Image Source="/Data/Images/TeamIcons/Kbo.png" Width="300" Opacity="0.3"
               HorizontalAlignment="Right" VerticalAlignment="Top"
               Margin="0,-90,-90,0"/>

        <!-- 메인 파노라마-->
        <controls:Panorama x:Name="Panorama" Margin="0,80,0,0"
                           SelectionChanged="Panorama_SelectionChanged">
            <!-- 경기 -->
            <controls:PanoramaItem>
                <StackPanel Margin="7,0,0,0">
                    <toolkit:DatePicker x:Name="GameDatePicker" Margin="-12,-12,-10,10" ValueStringFormat="{}{0:yyyy. MM. dd.}"
                                        Background="Transparent" Foreground="{StaticResource PhoneAccentBrush}"
                                        BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="1"
                                        ValueChanged="GameDatePicker_ValueChanged"/>
                    
                    <!-- 경기 리스트 박스 -->
                    <ListBox x:Name="GameListBox" Height="600"
                             Margin="0,0,0,50" VerticalAlignment="Top" IsEnabled="True">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Width="412" Margin="0,0,0,20">
                                    <Grid Height="40" Margin="0,0,0,15">
                                        <Rectangle Fill="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity=".5"/>
                                        <StackPanel Margin="10,5,0,0" Orientation="Horizontal">
                                            <TextBlock Text="{Binding Status}" Foreground="White"/>
                                            <TextBlock Text=", " Foreground="White"/>
                                            <TextBlock Text="{Binding Stadium}" Foreground="White" />
                                        </StackPanel>
                                        <TextBlock Text="{Binding StartTime}" Foreground="White" Margin="0,5,10,0" HorizontalAlignment="Right"/>
                                    </Grid>
                                    <StackPanel Margin="10,0,10,0">
                                        <Grid Margin="0,0,0,10">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="{Binding HomeTeamImage}" Width="60" VerticalAlignment="Center"/>
                                                <TextBlock Text="{Binding HomeTeam}" Margin="12,-7,0,0" FontSize="26" VerticalAlignment="Center"/>
                                            </StackPanel>
                                            <TextBlock Text="{Binding HomeTeamScore}" Margin="0,-11,0,0" FontSize="32" FontWeight="Bold" Foreground="{StaticResource PhoneAccentBrush}"
                                                       HorizontalAlignment="Right" VerticalAlignment="Center"/>
                                        </Grid>
                                        <Grid>
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="{Binding AwayTeamImage}" Width="60" VerticalAlignment="Center"/>
                                                <TextBlock Text="{Binding AwayTeam}" Margin="12,-7,0,0" FontSize="26" VerticalAlignment="Center"/>
                                            </StackPanel>
                                            <TextBlock Text="{Binding AwayTeamScore}" Margin="0,-11,0,0" FontSize="32" FontWeight="Bold" Foreground="{StaticResource PhoneAccentBrush}"
                                                       HorizontalAlignment="Right" VerticalAlignment="Center"/>
                                        </Grid>
                                    </StackPanel>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>

            <!-- 순위 -->
            <controls:PanoramaItem>
                <Grid/>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar Mode="Minimized" IsMenuEnabled="True" Opacity=".8">
            <shell:ApplicationBar.Buttons>
            </shell:ApplicationBar.Buttons>
            <shell:ApplicationBar.MenuItems>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>